<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>重置密码 - 账户管理</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="reset-password.css">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        secondary: '#36CFC9',
                        accent: '#722ED1',
                        neutral: '#F5F7FA',
                        dark: '#1D2129'
                    },
                    fontFamily: {
                        inter: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
</head>
<body>
    <div class="container mx-auto px-4 py-12 max-w-4xl">
        <div class="flex flex-col md:flex-row gap-8">
            <div class="md:w-1/2">
                <h1 class="text-3xl font-bold mb-4">重置密码</h1>
                <p class="text-gray-600 mb-6">请设置您的新密码，确保包含字母和数字，长度至少8位</p>
                
                <div class="bg-green-50 p-4 rounded-lg mb-6 hidden" id="success-message">
                    <h3 class="font-medium text-green-800 mb-2">密码已重置成功</h3>
                    <p class="text-green-700 text-sm">您的密码已成功更新，请使用新密码登录</p>
                </div>
                
                <div class="bg-red-50 p-4 rounded-lg mb-6 hidden" id="error-message">
                    <h3 class="font-medium text-red-800 mb-2">链接无效或已过期</h3>
                    <p class="text-red-700 text-sm">请重新请求密码重置链接</p>
                </div>
            </div>
            
            <div class="md:w-1/2 bg-white rounded-xl shadow-sm p-6 md:p-8">
                <form id="reset-password-form" class="space-y-5">
                    <div>
                        <label for="new-password" class="block text-sm font-medium text-gray-700 mb-1">新密码</label>
                        <div class="relative">
                            <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-gray-400">
                                <i class="fa fa-lock"></i>
                            </span>
                            <input type="password" id="new-password" 
                                   class="w-full pl-10 pr-10 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-primary/50 focus:border-primary outline-none transition-custom"
                                   placeholder="请设置新密码（至少8位）" minlength="8" required>
                            <button type="button" class="absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400 hover:text-gray-600 transition-custom toggle-password" data-target="new-password">
                                <i class="fa fa-eye-slash"></i>
                            </button>
                            <div class="error-message text-red-500 text-sm mt-1" id="new-password-error"></div>
                        </div>
                        <p class="text-xs text-gray-500 mt-1">密码长度至少8位，包含字母和数字</p>
                    </div>
                    
                    <div>
                        <label for="confirm-password" class="block text-sm font-medium text-gray-700 mb-1">确认新密码</label>
                        <div class="relative">
                            <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-gray-400">
                                <i class="fa fa-lock"></i>
                            </span>
                            <input type="password" id="confirm-password" 
                                   class="w-full pl-10 pr-10 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-primary/50 focus:border-primary outline-none transition-custom"
                                   placeholder="请再次输入新密码" minlength="8" required>
                            <button type="button" class="absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400 hover:text-gray-600 transition-custom toggle-password" data-target="confirm-password">
                                <i class="fa fa-eye-slash"></i>
                            </button>
                            <div class="error-message text-red-500 text-sm mt-1" id="confirm-password-error"></div>
                        </div>
                    </div>
                    
                    <input type="hidden" id="reset-token" value="">
                    
                    <button type="submit" 
                            class="w-full bg-primary hover:bg-primary/90 text-white font-medium py-3 px-4 rounded-lg transition-custom shadow-lg shadow-primary/20 hover:shadow-xl hover:shadow-primary/30">
                        确认重置密码
                    </button>
                    
                    <div class="text-center">
                        <a href="index.html" class="text-sm text-primary hover:text-primary/80 transition-custom">
                            返回登录
                        </a>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <script src="reset-password.js"></script>
</body>
</html>
